package com.desire.controller;


import com.desire.remote.StockRemoteClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description:
 * @Author: littleDesire
 * @Date: 2022-06-08 16:42
 * @Version: 1.0
 */
@RestController
@RequestMapping("/sale")
public class SaleController {

    @Autowired
    StockRemoteClient stockRemoteClient;

    @GetMapping("/query")
    public Map<String, Object>  query() {
        Map<String, Object> map = new HashMap<>();
        map.put("saleNo", "编号1001号商品");
        Map<String, Object> query = stockRemoteClient.query();
        map.put("stock", query);
        return map;
    }
}
